package Application.Mask;

import Application.LayerImage.LayerImage;
import java.util.Map;
import java.util.HashMap;
import javafx.scene.image.WritableImage;
import Application.File.FileAdd;

public class MaskManager {
    static MaskManager ins = new MaskManager();

    public static int MASK_SIZE = 32;

    private static String urlPrefix = "Assets/masks/";
//    private static String urlPrefix = "Application/Assets/masks/";

    Map<String, LayerImage> map = new HashMap<>();

    public static MaskManager getInstance() {
        return ins;
    }

    public LayerImage getMaskByName(String name) {
        if(map.containsKey(name)) {
            return map.get(name);
        } else {
            //LayerImage img = FileAdd.loadImage(name);
            LayerImage img = FileAdd.loadImage(urlPrefix + name + ".png");
            map.put(name, img);
            return img;
        }
    }
}
